package cn.edu.xjtu.data_structure.chapter03_tree_and_binary_tree.btree;

/**
 * @author yjq
 * @version 1.0
 * @date 2021/9/21 20:27
 */
public class BinNodePtr {
    //链式二叉树的结点类
    private Object element;//存储数据的元素
    private BinNodePtr left;//左子结点
    private BinNodePtr right;//右子结点

    //constructor部分
    public BinNodePtr(){}
    public BinNodePtr(Object element){
        this.element=element;
    }

    //getter与setter部分
    public Object getElement() {
        return element;
    }

    public void setElement(Object element) {
        this.element = element;
    }

    public BinNodePtr getLeft() {
        return left;
    }

    public void setLeft(BinNodePtr left) {
        this.left = left;
    }

    public BinNodePtr getRight() {
        return right;
    }

    public void setRight(BinNodePtr right) {
        this.right = right;
    }

    @Override
    public String toString() {
        return "BinNodePtr{" +
                "element=" + element +
                '}';
    }
}
